# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=cipherscan
pkgver=423.30bd239
pkgrel=1
pkgdesc='A very simple way to find out which SSL ciphersuites are supported by a target.'
groups=('blackarch' 'blackarch-scanner' 'blackarch-crypto')
url='https://github.com/jvehent/cipherscan'
license=('OpenSSL')
arch=('any')
depends=('bash' 'python2' 'openssl')
makedepends=('git')
source=("git+https://github.com/jvehent/$pkgname.git")
sha512sums=('SKIP')

pkgver() {
  cd $pkgname

  echo $(git rev-list --count HEAD).$(git rev-parse --short HEAD)
}

package() {
  cd $pkgname

  install -dm 755 "$pkgdir/usr/bin"
  install -dm 755 "$pkgdir/usr/share/$pkgname"

  install -Dm 644 README.md "$pkgdir/usr/share/doc/$pkgname/README.md"
  install -Dm 644 OpenSSL-LICENSE \
    "$pkgdir/usr/share/licenses/$pkgname/OpenSSL-LICENSE"

  rm README.md OpenSSL-LICENSE

  cp -a * "$pkgdir/usr/share/$pkgname/"

  cat > "$pkgdir/usr/bin/$pkgname" << EOF
#!/bin/sh
cd /usr/share/$pkgname
exec ./$pkgname "\$@"
EOF

  chmod +x "$pkgdir/usr/bin/$pkgname"
}

